/*
 * Copyright (c) 2008 Benoit Bouchez, Nicolas Giard
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.noocodecommit.wicket.stuff.jquery.plugin.ui.colorpicker;

import com.noocodecommit.wicket.stuff.jquery.plugin.JQPluginOptions;

/**
 * JQAccordion Option set
 * 
 * @author Benoit Bouchez
 * 
 */
public class JQColorPickerOptions extends JQPluginOptions implements Cloneable
{
	private String eventName = "click";
	private String color = "ff0000";
	private boolean flat = false;

	private String showScript = "";
	private String beforeShowScript = "";
	private String changeScript = "";
	private String submitScript = "";
	private String hideScript = "";

	/**
	 * Constructor
	 */
	public JQColorPickerOptions()
	{
		super();
		this.setDefaultHeader("colorpicker");
	}

	/**
	 * Gets the eventName value
	 * 
	 * @return the eventName value
	 */
	public String getEventName()
	{
		return eventName;
	}

	/**
	 * Sets the eventName option value
	 * 
	 * @param eventName
	 *            colorpicker eventName
	 */
	public void setEventName(String eventName)
	{
		this.eventName = eventName;
		this.options.put("eventName", "eventName:'" + eventName + "'");
	}

	/**
	 * Gets the color value
	 * 
	 * @return the color value
	 */
	public String getColor()
	{
		return color;
	}

	/**
	 * Sets the color option value
	 * 
	 * @param color
	 *            colorpicker color
	 */
	public void setColor(String color)
	{
		this.color = color;
		this.options.put("color", "color:'" + color + "'");
	}

	/**
	 * Gets the flat value
	 * 
	 * @return the flat value
	 */
	public boolean isFlat()
	{
		return flat;
	}

	/**
	 * Sets the flat option value
	 * 
	 * @param flat
	 *            colorpicker flat
	 */
	public void setFlat(boolean flat)
	{
		this.flat = flat;
		this.options.put("flat", "flat:" + flat);
	}

	/**
	 * Gets the show script value
	 * 
	 * @return the show function
	 */
	public String getShowScript()
	{
		return showScript;
	}

	/**
	 * Sets the show function
	 * 
	 * @param showScript
	 *            colorpicker show function
	 */
	public void setShowScript(String showScript)
	{
		this.showScript = showScript;
		this.options.put("show", "show:function(e, ui){" + showScript + "}");
	}

	/**
	 * Gets the beforeShow script value
	 * 
	 * @return the beforeShow function
	 */
	public String getBeforeShowScript()
	{
		return beforeShowScript;
	}

	/**
	 * Sets the beforeShow function
	 * 
	 * @param beforeShowScript
	 *            colorpicker beforeShow function
	 */
	public void setBeforeShowScript(String beforeShowScript)
	{
		this.beforeShowScript = beforeShowScript;
		this.options.put("beforeShow", "beforeShow:function(e, ui){" + beforeShowScript + "}");
	}

	/**
	 * Gets the change script value
	 * 
	 * @return the change function
	 */
	public String getChangeScript()
	{
		return changeScript;
	}

	/**
	 * Sets the change function
	 * 
	 * @param changeScript
	 *            colorpicker change function
	 */
	public void setChangeScript(String changeScript)
	{
		this.changeScript = changeScript;
		this.options.put("change", "change:function(e, ui){" + changeScript + "}");
	}

	/**
	 * Gets the submit script value
	 * 
	 * @return the submit function
	 */
	public String getSubmitScript()
	{
		return submitScript;
	}

	/**
	 * Sets the submit function
	 * 
	 * @param submitScript
	 *            colorpicker submit function
	 */
	public void setSubmitScript(String submitScript)
	{
		this.submitScript = submitScript;
		this.options.put("submit", "submit:function(e, ui){" + submitScript + "}");
	}

	/**
	 * Gets the hide script value
	 * 
	 * @return the hide function
	 */
	public String getHideScript()
	{
		return hideScript;
	}

	/**
	 * Sets the hide function
	 * 
	 * @param hideScript
	 *            colorpicker hide function
	 */
	public void setHideScript(String hideScript)
	{
		this.hideScript = hideScript;
		this.options.put("hide", "hide:function(e, ui){" + hideScript + "}");
	}

	@Override
	protected Object clone() throws CloneNotSupportedException
	{
		JQColorPickerOptions clone = (JQColorPickerOptions) super.clone();
		return clone;
	}

}
